<template>
<div>
  <button @click="show=true">打开模态框</button>
  <modal v-if="show" @close="show=false">
    <h3 slot="header">自定义标题</h3>
    <span slot="body">自定义内容</span>
  </modal>
</div>
</template>
<script>
  import Modal from './Modal.vue'
  export default{
    data() {
      return {
        show: false
      }
    },
    components: {
      Modal
    }
  }
</script>
<style lang="scss" scoped>
.modal-header h3{
  margin-top:0;
  color: #42b983;
}
</style>

